package com.yh.csx.event.common.exception;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum ExceptionEnum {
    MAP_2_BEAN_ERROR(-1000000, "Map转换Bean[%s]失败"),
    NO_STATUS_TYPE(-1000000, "不存在该【%s】类型状态"),
    NOT_NULL(-1000000, "字段不能为空，请检查字段：%s"),
    CONVERT_2_MAP_ERROR(-1000000, "对象转换为Map错误，请检查对象：%s"),
    EVENT_CREATE_ERROR(-1000000, "事件创建失败，请检查关键字段：%s"),
    EVENT_GET_VALUE_TYPE_ERROR(-1000000, "事件获取值，该Key:%s,类型期望是：%s,实际是：%s");

    private int code;
    private String message;

    public String format(String... key) {
        return String.format(message, key);
    }
}
